//************************************************************************
/// <copyrigth>2024-2025 Corporation.All Rights Reserved</copyrigth>
/// <author>tangyingzhong</author>
/// <contact>tangyz114987@outlook.com</contact>
/// <version>v1.0.0</version>
/// <describe>
/// Cross-Platform GUID
///</describe>
/// <date>2024/1/8</date>
///***********************************************************************
#ifndef GUID_H
#define GUID_H

#include <string>
#include "ModuleLoader/ModuleConfig.h"

namespace SystemTool
{
    class CLASS_ITEM Guid
    {
    public:
        // Create default uuid
        static Guid CreateByRandom();

        // Create an uuid from a string
        static Guid FromString(std::string strUuid);

        // Copy from the buffer(buffer has network byte order)
        static Guid CopyFrom(char* pBuffer);

        // Copy to the buffer(buffer has network byte order)
        void CopyTo(char* pBuffer);

        // Uuid to string
        std::string ToString();

    private:
        unsigned int m_iTimeLow;
        unsigned short m_iTimeMid;
        unsigned short m_iTimeHiAndVersion;
        unsigned short m_iClockSeq;
        unsigned char m_NodeTable[6];
    };
}

#endif //GUID_H
